﻿#Region "Copyright"
'————————————————————————————————————————
'	创建人员(Creator)    ：Huangyd
'	创建日期(Date)       ：2012-07-14
'   联系方式(Email)      ：aj-ayumi@163.com; gajayumi@gmail.com; ajayumi@me.com
'   描    述(Description)：
'
'	Copyright (C) 2012 ajayumi 版权所有
'————————————————————————————————————————
#End Region
Imports ajayumi.develop.VBasic.Core.Win.WinAPI

Namespace Machine


    Public Class FormHelper
#Region "变量 -- dwflag的取值"
        Private Const AW_HOR_POSITIVE As Integer = &H1
        '从左到右显示 
        Private Const AW_HOR_NEGATIVE As Integer = &H2
        '从右到左显示 
        Private Const AW_VER_POSITIVE As Integer = &H4
        '从上到下显示 
        Private Const AW_VER_NEGATIVE As Integer = &H8
        '从下到上显示 
        Private Const AW_CENTER As Integer = &H10
        '若使用了AW_HIDE标志，则使窗口向内重叠，即收缩窗口；否则使窗口向外扩展，即展开窗口 
        Private Const AW_HIDE As Integer = &H10000
        '隐藏窗口，缺省则显示窗口 
        Private Const AW_ACTIVATE As Integer = &H20000
        '激活窗口。在使用了AW_HIDE标志后不能使用这个标志 
        Private Const AW_SLIDE As Integer = &H40000
        '使用滑动类型。缺省则为滚动动画类型。当使用AW_CENTER标志时，这个标志就被忽略 
        Private Const AW_BLEND As Integer = &H80000
#End Region


#Region "公开方法"
        ''' <summary>
        ''' 由中心向边界扩展渐进打开窗口
        ''' </summary>
        ''' <param name="wnd"></param>
        ''' <param name="dwtime"></param>
        ''' <remarks></remarks>
        Public Shared Sub ShowFXCenter(ByVal wnd As IntPtr, ByVal dwtime As Integer)
            User32Dll.AnimateWindow(wnd, dwtime, AW_CENTER Or AW_ACTIVATE Or AW_SLIDE)
        End Sub


        ''' <summary>
        ''' 由边界向中心扩展渐进关闭窗口
        ''' </summary>
        ''' <param name="wnd"></param>
        ''' <param name="dwtime"></param>
        ''' <remarks></remarks>
        Public Shared Sub HideFXCenter(ByVal wnd As IntPtr, ByVal dwtime As Integer)
            User32Dll.AnimateWindow(wnd, dwtime, AW_CENTER Or AW_HIDE Or AW_SLIDE)
        End Sub

#End Region
    End Class

End Namespace